#!/bin/sh

#####################################################################
# usage:
# sh start.sh -- start application @dev
# sh start.sh ${env} -- start application @${env}

# examples:
# sh start.sh prod -- use conf/nginx-prod.conf to start OpenResty
# sh start.sh -- use conf/nginx-dev.conf to start OpenRest
#####################################################################

if [ -n "$1" ];then
	PROFILE="$1"
else
   PROFILE=dev
fi

mkdir -p tmp && mkdir -p tmp/logs
echo "Use profile: "${PROFILE}
/usr/local/openresty/1.15.8/bin/openresty -p `pwd`/tmp -c `pwd`/nginx-${PROFILE}.conf
